# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=mauikit-imagetools
pkgver=3.0.1
pkgrel=2
pkgdesc='MauiKit Image Tools Components'
url='https://mauikit.org/'
arch=(loong64 x86_64)
license=(LGPL)
depends=(mauikit kquickimageeditor5 qt5-location exiv2 tesseract)
makedepends=(extra-cmake-modules opencv)
source=(https://download.kde.org/stable/maui/$pkgname/$pkgver/$pkgname-$pkgver.tar.xz
        leptonica-1.83.patch)
sha256sums=('6a07cefa867f2428483fb807ed4aa4886be66598a9be1a6eb1a32d336b855e29'
            'ffc6454feb8d2c11fcd83ab5323487d163e35bf37e43b5f3ff9f436a93fbb4d1')

prepare() {
  patch -d $pkgname-$pkgver -p1 < leptonica-1.83.patch
}

build() {
  cmake -B build -S $pkgname-$pkgver
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
